package Book;

public class Book {
    private String bookname;//书名
    private String author;
    private int price;
    private String type;
    private boolean isBorrow;//是否被借阅

    public Book(String bookname, String author, int price, String type) {
        this.bookname = bookname;
        this.author = author;
        this.price = price;
        this.type = type;
    }

    public String getBookname() {
        return bookname;
    }

    public void setBookname(String bookname) {
        this.bookname = bookname;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean isBorrow() {
        return isBorrow;
    }

    public void setBorrow(boolean borrow) {
        isBorrow = borrow;
    }

    @Override
    public String toString() {
        return "Book{" +
                "bookname='" + bookname + '\'' +
                ", author='" + author + '\'' +
                ", price=" + price +
                ", type='" + type + '\'' +
                ", Borrow='" +
                ((isBorrow == true) ? "已借出'" : "未借出'") +
                '}';
    }
}
